
<!doctype html>
<html>
<head>
	<meta charset="utf-8" />
	<link rel="stylesheet" type="text/css" href="/css/unbind.css" />
	<title>设备解绑</title>
	<style type="text/css">
	</style>
</head>
<body>
	<section class="pages">
		<section class="unbindList">
				<section class="bindLogBg"><img src="/img/1508bindLog.png" /></section>
				<section class="bindData">
					<p>设备编号：<span class="deviceCode">{{ $device_code or 56546456}}</span></p>
					<p>设备型号：<span class="deviceModel">{{ $type }}</span></p>
				</section>
				<section class="bindText">已绑定</section>
		</section>
		<section class="unbindFooterBtn">
			<a class="btnGoBack" onclick="javascript:history.go(-1)">返回</a>
			<a class="unbindBtn">解绑设备</a>
		</section>
		<!-- 确认取消提示start -->
		<section class="undbing_bg">
			<section class="undbing_box">
				<p style="margin:2.3rem 0;">确定要解绑当前设备吗？</p>
				<section>
					<a class="no_btn" >取消</a>
					<a class="yes_btn">确定</a>
				</section>
			</section>
		</section>
		<!-- 确认取消提示 end -->
		<!-- 提交信息服务器反馈提示信息-->
		<section class="hint_bg">
			<section class="hint_box">
				<p class="hint_text"></p>
				<section class="hint_btn">确定</section>
			</section>
		</section>
	</section>
	<script src="/js/jquery.min.js"></script>
	<script src="/js/public.js"></script>
	<script src="/js/unbind.js"></script>
	<script type="text/javascript">
		window.onload=function(){
			$(".bindLogBg img")[0].src='/img/'+'{{ $type }}'+'bindLog.png';
			$(".unbindBtn").click(function(){
				$(".undbing_bg").show();
				$(".undbing_bg").height($(window).height());
				$(".no_btn").unbind('click').click(function(){
					$(".undbing_bg").hide();
				});
				$(".yes_btn").unbind('click').click(function(){
					$.ajax({
						url:'/api/device/{{ $type }}/unbind',
						type:'post',
						dataType:'json',
						data:{device_code:$(".deviceCode").html()},
						success:function(data){
							if(data.status.errCode == 0){
								$(".undbing_bg").hide();
								$(".unbindList").remove();
								hint('解绑成功');
								setTimeout(function(){
		    						window.location.href = "/index?"+new Date().getTime();
		    					},300);
							}else{
								hint(data.status.message);
							}
						}
					});
				});
			});
		};
	</script>
</body>
</html>
